//
//  GuangDetaViewCell.m
//  Shopping
//
//  Created by qianfeng on 16/1/15.
//  Copyright © 2016年 qianfeng. All rights reserved.
//

#import "GuangDetaViewCell.h"

#import "GuangAllModle.h"
#import "UIImageView+WebCache.h"

@implementation GuangDetaViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+(instancetype)cellWithTableView:(UITableView *)tableView
{
    GuangDetaViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"DetaCell"];
    if (cell == nil) {
        cell = [[GuangDetaViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DetaCell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    return cell;
}
-(void)setModel:(GuangAllModle *)model
{
    _model = model;
    
    NSString * str = [model.imgs componentsSeparatedByString:@"[\""].lastObject;
    NSString * last = [str componentsSeparatedByString:@"\"]"].firstObject;
    
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://pic12.secooimg.com/%@",last]] placeholderImage:[UIImage imageNamed:@"loading"]];
    self.titleLable.text = model.title;
    self.detaLabel.text = model.content;
    
    
    
}


- (IBAction)btnGood:(UIButton *)sender {
    
    DJLog(@"赞一个");
}

- (IBAction)btnCollection:(UIButton *)sender {
    DJLog(@"收藏");
}
@end
